



;(function() {
  window.ovine.addPageSchemaJs('/test/demoapp1', {
    schema: {
      "type": "page",
      "body": {
        "type": "lib-crud",
        "api": {
          "url": "GET demoapp1/demoapp1/",
          "limits": "$page",
          "actionAddr": "/demoapp1/demoapp1@##@$page",
          "api": "GET demoapp1/demoapp1/"
        },
        "filter": {
          "controls": [
            {
              "type": "text",
              "name": "search",
              "label": "关键字",
              "clearable": true,
              "placeholder": ""
            },
            
            {
              "type": "submit",
              "className": "m-l",
              "label": "搜索",
              "level": "primary"
            },
            {
              "type": "wrapper",
              "className": "no-wrapper m-l a-Form-item a-Form-item--inline ",
              "body": [
                {
                  "type": "action",
                  "actionType": "link",
                  "link": "/demo/test/demoapp1",
                  "label": "重置"
                }
              ]
            }
          ]
        },
        "filterTogglable": true,
        "perPageField": "size",
        "pageField": "page",
        "perPageAvailable": [
          50,
          100,
          200
        ],
        "defaultParams": {
          "size": 50
        },
        "headerToolbar": [
          "filter-toggler",
          {
            "type": "columns-toggler",
            "align": "left"
          },
          {
            "limits": "editItem",
            "type": "button",
            "align": "right",
            "actionType": "dialog",
            "label": "添加",
            "icon": "fa fa-plus pull-left",
            "size": "sm",
            "primary": true,
            "dialog": {
              "title": "新增",
              "body": {
                "type": "form",
                "name": "sample-edit-form",
                "api": {
                  "url": "POST demoapp1/demoapp1/",
                  "limits": "editItem",
                  "actionAddr": "/demoapp1/demoapp1@##@editItem",
                  "api": "POST demoapp1/demoapp1/"
                },
                "$ref": "updateControls"
              }
            }
          }
        ],
        "footerToolbar": [
          "statistics",
          "switch-per-page",
          "pagination"
        ],
        "columns": [
          {
            "name": "id",
            "label": "ID",
            "type": "text"
          },
          
          

            {
              "type": "text",
              "name": "aab",
              "label": "aaa",
            },
          

            {
              "type": "text",
              "name": "bb",
              "label": "bbb",
            },
          

          {
            "name": "create_time",
            "label": "创建时间",
            "type": "datetime"
          },
          {
            "name": "update_time",
            "label": "更新时间",
            "type": "datetime"
          },
          {
            "name": "operator_name",
            "label": "操作人",
            "type": "text"
          },
          {
            "type": "operation",
            "label": "操作",
            "width": 60,
            "limits": [
              "editItem"
            ],
            "limitsLogic": "or",
            "buttons": [
              {
                "limits": "editItem",
                "type": "button",
                "icon": "fa fa-pencil",
                "tooltip": "编辑",
                "actionType": "dialog",
                "dialog": {
                  "title": "编辑",
                  "body": {
                    "type": "form",
                    "name": "sample-edit-form",
                    "api": {
                      "url": "PUT demoapp1/demoapp1/$id/",
                      "limits": "editItem",
                      "actionAddr": "/demoapp1/demoapp1@##@editItem",
                      "api": "PUT demoapp1/demoapp1/$id/"
                    },
                    "$ref": "updateControls"
                  }
                }
              },
              {
                "limits": "editItem",
                "type": "button",
                "icon": "fa fa-times text-danger",
                "actionType": "ajax",
                "tooltip": "删除",
                "confirmText": "您确认要删除?",
                "api": {
                  "url": "DELETE demoapp1/demoapp1/$id/",
                  "limits": "editItem",
                  "actionAddr": "/demoapp1/demoapp1@##@editItem",
                  "api": "DELETE demoapp1/demoapp1/$id/"
                },
                "messages": {
                  "success": "删除成功",
                  "failed": "删除失败"
                }
              }
            ]
          }
        ]
      },
      "definitions": {       
        "updateControls": {
          "controls": [


    

            {
              "type": "text",
              "name": "aab",
              "label": "aaa",
              "format": "YYYY-MM-DD HH:mm:ss",

              "required": true
            },
    

            {
              "type": "text",
              "name": "bb",
              "label": "bbb",
              "format": "YYYY-MM-DD HH:mm:ss",

              "required": true
            },
    

          ]
        }
      },
      "preset": {
        "actions": {
          "add": {
            "limits": "editItem",
            "type": "button",
            "align": "right",
            "actionType": "dialog",
            "label": "添加",
            "icon": "fa fa-plus pull-left",
            "size": "sm",
            "primary": true,
            "dialog": {
              "title": "新增",
              "body": {
                "type": "form",
                "name": "sample-edit-form",
                "api": {
                  "url": "POST demoapp1/demoapp1/",
                  "limits": "editItem",
                  "actionAddr": "/demoapp1/demoapp1@##@editItem",
                  "api": "POST demoapp1/demoapp1/"
                },
                "$ref": "updateControls"
              }
            }
          },
          "edit": {
            "limits": "editItem",
            "type": "button",
            "icon": "fa fa-pencil",
            "tooltip": "编辑",
            "actionType": "dialog",
            "dialog": {
              "title": "编辑",
              "body": {
                "type": "form",
                "name": "sample-edit-form",
                "api": {
                  "url": "PUT demoapp1/demoapp1/$id/",
                  "limits": "editItem",
                  "actionAddr": "/demoapp1/demoapp1@##@editItem",
                  "api": "PUT demoapp1/demoapp1/$id/"
                },
                "$ref": "updateControls"
              }
            }
          },
          "del": {
            "limits": "editItem",
            "type": "button",
            "icon": "fa fa-times text-danger",
            "actionType": "ajax",
            "tooltip": "删除",
            "confirmText": "您确认要删除?",
            "api": {
              "url": "DELETE demoapp1/demoapp1/$id/",
              "limits": "editItem",
              "actionAddr": "/demoapp1/demoapp1@##@editItem",
              "api": "DELETE demoapp1/demoapp1/$id/"
            },
            "messages": {
              "success": "删除成功",
              "failed": "删除失败"
            }
          }
        },
        "forms": {
          "filter": {
            "controls": [
              {
                "type": "text",
                "name": "search",
                "label": "关键字",
                "clearable": true,
                "placeholder": "ID/登录账号/名称"
              },
              {
                "$ref": "sysRoleIdPicker"
              },
              {
                "type": "submit",
                "className": "m-l",
                "label": "搜索",
                "level": "primary"
              },
              {
                "type": "wrapper",
                "className": "no-wrapper m-l a-Form-item a-Form-item--inline ",
                "body": [
                  {
                    "type": "action",
                    "actionType": "link",
                    "link": "/demo/test/demoapp1",
                    "label": "重置"
                  }
                ]
              }
            ]
          }
        },
        "limits": {
          "$page": {
            "label": "查看列表"
          },
          "editItem": {
            "label": "编辑"
          }
        },
        "apis": {
          "list": {
            "url": "GET demoapp1/demoapp1/",
            "limits": "$page",
            "actionAddr": "/demoapp1/demoapp1@##@$page",
            "api": "GET demoapp1/demoapp1/"
          },
          "add": {
            "url": "POST demoapp1/demoapp1/",
            "limits": "editItem",
            "actionAddr": "/demoapp1/demoapp1@##@editItem",
            "api": "POST demoapp1/demoapp1/"
          },
          "edit": {
            "url": "PUT demoapp1/demoapp1/$id/",
            "limits": "editItem",
            "actionAddr": "/demoapp1/demoapp1@##@editItem",
            "api": "PUT demoapp1/demoapp1/$id/"
          },
          "del": {
            "url": "DELETE demoapp1/demoapp1/$id/",
            "limits": "editItem",
            "actionAddr": "/demoapp1/demoapp1@##@editItem",
            "api": "DELETE demoapp1/demoapp1/$id/"
          }
        },
        "nodePath": "/demoapp1/demoapp1"
      }
    }
  })
})()